import { createRouter, createWebHashHistory } from 'vue-router';
import LoginView from '../views/LoginView.vue';

const routes = [
  {
    path:'/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/main',
    name: 'main',
    redirect:'/main/basic',
    component: () => import('../views/MainView.vue'),
    children:[
      {
        path:'/main/basic',
        name:'basic',
        component:()=> import('../views/MainBasicView.vue')
      },
      {
        path:'/main/qualifications',
        name:'qlfc',
        component:()=>import('../views/MainQlfcView.vue')
      },
      {
        path:'/Main/goods',
        name:'goods',
        component:()=>import('../views/MainGoodsView.vue')
      },
      {
        path:'/Main/order',
        name:'order',
        component:()=>import('../views/MainOrderView.vue')
      },
      {
        path:'/Main/comment',
        name:'comment',
        component:()=>import('../views/MainCommentView.vue')
      },
      {
        path:'/Main/store',
        name:'store',
        component:()=>import('../views/MainStoreView.vue')
      },
      {
        path:'/Main/buy',
        name:'buy',
        component:()=>import('../views/MainBuyView.vue')
      },
      {
        path:'/Main/send',
        name:'send',
        component:()=>import('../views/MainSendView.vue')
      }
    ]
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});


export default router;
